package com.liguoqing.Service.impl;

import com.liguoqing.Service.UserService;
import com.liguoqing.beans.User;
import com.liguoqing.dao.UserDAO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDAO userDAO;

    @Transactional
    public User checkLogin(String userName, String userPwd) {

        User user = userDAO.queryUserByName(userName);

        //加密
        if (user.getUserPwd().equals(userPwd)){
            return user;
        }else {
            return null;
        }

    }
}
